﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Pulse
{
    /* The graphical representation of a map cell */
    static class Tile
    {
        // Tile settings for square tiles
        //static public Texture2D tileSet;
        //static public int tileWidth = 32;
        //static public int tileHeight = 32;
        //static public int TileStepX = 32;
        //static public int TileStepY = 32;
        //static public int OddRowXOffset = 0;
        //static public int HeightTileOffset = 0;

        // Tile settings for isometric tiles
        static public Texture2D tileSet;
        static public int tileWidth = 128;
        static public int tileHeight = 128;
        static public int TileStepX = 128;
        static public int TileStepY = 32;
        static public int OddRowXOffset = 64;
        static public int HeightTileOffset = 64;

        //static public Texture2D tileSet;
        //static public int tileWidth = 64;
        //static public int tileHeight = 64;
        //static public int TileStepX = 64;
        //static public int TileStepY = 16;
        //static public int OddRowXOffset = 32;
        //static public int HeightTileOffset = 32;

        static public Rectangle GetSourceTile(int index)
        {
            int tileY = index / (tileSet.Width / tileWidth);
            int tileX = index % (tileSet.Width / tileWidth);

            return new Rectangle(tileX * tileWidth, tileY * tileHeight, tileWidth, tileHeight);
        }
    }
}
